package cn.snailhd.api.test.project.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.snailhd.core.base.dao.MyBatisDao;
import cn.snailhd.core.base.domain.BaseResultDTO;

@Controller
@RequestMapping(value="/project")
public class ProjectController {
	
	@Autowired
	MyBatisDao dao;
	
	@RequestMapping(value="/{projectid}")
	@ResponseBody
	public String main(@PathVariable String projectid){
		BaseResultDTO re = new BaseResultDTO();
		List<Map> list =  dao.selectList("projectMapper.queryProjectList", projectid);
		re.put("list", list);
		return re.setSuccess().toJSON();
	}
	
	
	@RequestMapping(value="/versionList")
	@ResponseBody
	public String versionList(String projectid){
		BaseResultDTO re = new BaseResultDTO();
		List<Map> list = dao.selectList("projectMapper.queryVersionList", projectid);
		return re.setSuccess().toJSON();
	}
	
}
